package com.axiang.module_work.fragment;


import androidx.lifecycle.ViewModelProvider;
import androidx.fragment.app.Fragment;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.axiang.lib_common.mvvm.fragment.BaseMvvmRefreshFragment;
import com.axiang.module_work.bean.HomeMessageBean;
import com.ren.lib_path.router.RouterFragmentPath;
import com.axiang.module_work.BR;
import com.axiang.module_work.R;
import com.axiang.module_work.databinding.FragmentWorkBinding;
import com.axiang.module_work.factory.WorkViewModelFactory;
import com.axiang.module_work.viewmodel.WorkViewModel;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

/**
 * A simple {@link Fragment} subclass.
 */
@Route(path = RouterFragmentPath.Work.PAGER_WORK)
public class WorkFragment extends BaseMvvmRefreshFragment<HomeMessageBean, FragmentWorkBinding, WorkViewModel> {

    @Override
    public int onBindLayout() {
        return R.layout.fragment_work;
    }

    @Override
    public void initData() {
        autoLoadData();
    }

    @Override
    public String getToolbarTitle() {
        return "工作";
    }

    @Override
    public boolean enableToolbar() {
        return true;
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mBinding.refreshLayout;
    }

    @Override
    public Class<WorkViewModel> onBindViewModel() {
        return WorkViewModel.class;
    }

    @Override
    public ViewModelProvider.Factory onBindViewModelFactory() {
        return WorkViewModelFactory.getInstance(mActivity.getApplication());
    }

    @Override
    public void initViewObservable() {

    }

    @Override
    public boolean enableLazyData() {
        return true;
    }

    @Override
    public int onBindVariableId() {
        return BR.viewModel;
    }
}
